import { httpUtil } from '../../utils/httpUtil'
import urls from './url'
import util = require('util');
const hostname = 'api.tophub.fun'
export default {
    GetAllType () {
        return httpUtil.secureGet({
            hostname,
            path : urls.GetAllType
        })
    },
    GetById (params) {
        const GetAllInfo = util.format(
            urls.GetAllInfo,
            params.id || 1065,
            params.page || 0,
            params.type || 'pc'
        )
        return httpUtil.secureGet({
            hostname,
            path : GetAllInfo
        })
    },
    hotNews (params) {
        const hotNews = util.format(
            urls.hotNews,
            params.id || 1006,
            params.page || 0,
            params.type || 'pc'
        )
        return httpUtil.secureGet({
            hostname,
            path : hotNews
        })
    },
    toutiao (params) {
        const hotNews = util.format(
            urls.toutiao,
            // params.id || 1006,
            // params.page || 0,
            // params.type || 'pc'
        )
        return httpUtil.secureGet({
            hostname: 'm.toutiao.com',
            path : hotNews
        })
    }
}